/**
 * Created by Administrator on 2017/1/21.
 */

var MJ = require('../MJ/MJ');

var ScoreRule = clone(MJ.ScoreRule);
ScoreRule.QingYiSe =  201;      // 平湖清一色
ScoreRule.HHQDQYS = 202;        // 豪华七对清一色
ScoreRule.QQRQYS = 203;         // 全求人清一色


var Pattern = {
    'NONE': 0,                // 不是可胡的牌型
    'NORMAL': MJ.Pattern.NORMAL,                // 平胡
    'KADAN': 6,                                 // 卡单胡
    'PAIR': MJ.Pattern.PAIR,                    // 碰碰胡
    'PAIR7': MJ.Pattern.PAIR7,                  // 七对胡
    'HHQD': 5,                                  // 豪华七对
    'SINGLE':MJ.Pattern.SINGLE,                 // 全球人
    'ZYS' : 7                                   // 字一色

};

var PatternScore = {}
PatternScore[Pattern.BT] = 0;
PatternScore[Pattern.NORMAL] = 1;
PatternScore[Pattern.KADAN] = 2;
PatternScore[Pattern.PAIR] = 3;
PatternScore[Pattern.PAIR7] = 4;
PatternScore[Pattern.SINGLE] = 5;
PatternScore[Pattern.ZYS] = 5;
PatternScore[Pattern.HHQD] = 8;


var ItemScore = {};
ItemScore[ScoreRule.DH] = 1;    //*1
ItemScore[ScoreRule.ZM] = 1;
ItemScore[ScoreRule.GSH] = 2;
ItemScore[ScoreRule.QG] = 3;

ItemScore[ScoreRule.TH] = 20;  // = 20
ItemScore[ScoreRule.DIHU] = 20;

ItemScore[ScoreRule.QingYiSe] = 4;  // 清一色
ItemScore[ScoreRule.HHQDQYS] = 8;   // 豪华七对清一色
ItemScore[ScoreRule.QQRQYS] = 5;    // 全求人清一色



var ScoreReason = {
    DH: MJ.Result.DH,  // 点胡/点炮
    ZM: MJ.Result.ZM,  // 自摸/被自摸
    PIAO: 301,          // 飘

    BT: ScoreRule.BT, // 报听
    LZ: ScoreRule.LZ, // 庄家
    QG: ScoreRule.QG, // 抢杠
};

var GangScore = {};
GangScore[MJ.Gang.BA] = 1;
GangScore[MJ.Gang.AN] = 1;
GangScore[MJ.Gang.DIAN] = 1;
GangScore[MJ.Gang.ANS] = 1;

exports.ScoreRule = ScoreRule;
exports.Pattern = Pattern;
exports.PatternScore = PatternScore;
exports.ItemScore = ItemScore;
exports.ScoreReason = ScoreReason;
exports.GangScore = GangScore;
